+2003-09-24 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
+
+ * gtk/gtkuimanager.c (update_node): Don't complain about missing
+ actions on popups. Re-set "tooltip" property on toolitems after
+ adding them to parent to trigger proxy update.
+
2003-09-22 Matthias Clasen <maclas@gmx.de>
* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
+2003-09-24 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
+
+ * gtk/gtkuimanager.c (update_node): Don't complain about missing
+ actions on popups. Re-set "tooltip" property on toolitems after
+ adding them to parent to trigger proxy update.
+
2003-09-22 Matthias Clasen <maclas@gmx.de>
* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
+2003-09-24 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
+
+ * gtk/gtkuimanager.c (update_node): Don't complain about missing
+ actions on popups. Re-set "tooltip" property on toolitems after
+ adding them to parent to trigger proxy update.
+
2003-09-22 Matthias Clasen <maclas@gmx.de>
* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
+2003-09-24 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
+
+ * gtk/gtkuimanager.c (update_node): Don't complain about missing
+ actions on popups. Re-set "tooltip" property on toolitems after
+ adding them to parent to trigger proxy update.
+
2003-09-22 Matthias Clasen <maclas@gmx.de>
* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
+2003-09-24 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkaction.c (connect_proxy): Sync tooltips on toolitems.
+
+ * gtk/gtkuimanager.c (update_node): Don't complain about missing
+ actions on popups. Re-set "tooltip" property on toolitems after
+ adding them to parent to trigger proxy update.
+
2003-09-22 Matthias Clasen <maclas@gmx.de>
* tests/testmerge.c (main): Initially activate the JUSTIFY_RIGHT
#include <config.h>
#include "gtkaction.h"
+#include "gtkaccellabel.h"
#include "gtkbutton.h"
-#include "gtktoolbutton.h"
-#include "gtkmenuitem.h"
-#include "gtkimagemenuitem.h"
-#include "gtkstock.h"
-#include "gtklabel.h"
#include "gtkimage.h"
-#include "gtkaccellabel.h"
+#include "gtkimagemenuitem.h"
#include "gtkintl.h"
+#include "gtklabel.h"
+#include "gtkmenuitem.h"
+#include "gtkstock.h"
+#include "gtktoolbutton.h"
+#include "gtktoolbar.h"
#define GTK_ACTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ACTION, GtkActionPrivate))
}
}
+static void
+gtk_action_sync_tooltip (GtkAction *action,
+ GParamSpec *pspec,
+ GtkWidget *proxy)
+{
+ g_return_if_fail (GTK_IS_TOOL_ITEM (proxy));
+
+ if (GTK_IS_TOOLBAR (gtk_widget_get_parent (proxy)))
+ {
+ GtkToolbar *toolbar = GTK_TOOLBAR (gtk_widget_get_parent (proxy));
+
+ gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (proxy),
+ toolbar->tooltips,
+ action->private_data->tooltip,
+ NULL);
+ }
+}
+
+
static gboolean
gtk_action_create_menu_proxy (GtkToolItem *tool_item,
GtkAction *action)
"stock_id", action->private_data->stock_id,
"is_important", action->private_data->is_important,
NULL);
+ /* FIXME: we should set the tooltip here, but the current api
+ * doesn't allow it before the item is added to a toolbar.
+ */
g_signal_connect_object (action, "notify::short_label",
G_CALLBACK (gtk_action_sync_short_label),
proxy, 0);
g_signal_connect_object (action, "notify::is_important",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
+ g_signal_connect_object (action, "notify::tooltip",
+ G_CALLBACK (gtk_action_sync_tooltip),
+ proxy, 0);
g_signal_connect_object (proxy, "create_menu_proxy",
G_CALLBACK (gtk_action_create_menu_proxy),
#include <config.h>
#include <string.h>
-#include "gtkuimanager.h"
-#include "gtktoolbar.h"
-#include "gtkseparatortoolitem.h"
-#include "gtkmenushell.h"
+#include "gtkintl.h"
+#include "gtkmarshalers.h"
#include "gtkmenu.h"
#include "gtkmenubar.h"
+#include "gtkmenushell.h"
#include "gtkseparatormenuitem.h"
+#include "gtkseparatortoolitem.h"
#include "gtktearoffmenuitem.h"
-#include "gtkintl.h"
+#include "gtktoolbar.h"
+#include "gtkuimanager.h"
#undef DEBUG_UI_MANAGER
Node *info;
GNode *child;
GtkAction *action;
+ gchar *tooltip;
#ifdef DEBUG_UI_MANAGER
GList *tmp;
#endif
info->type != NODE_TYPE_ROOT &&
info->type != NODE_TYPE_MENUBAR &&
info->type != NODE_TYPE_TOOLBAR &&
+ info->type != NODE_TYPE_POPUP &&
info->type != NODE_TYPE_SEPARATOR &&
info->type != NODE_TYPE_MENU_PLACEHOLDER &&
info->type != NODE_TYPE_TOOLBAR_PLACEHOLDER)
if (find_menu_position (node, &menushell, &pos))
{
info->proxy = gtk_action_create_menu_item (action);
-
+
gtk_menu_shell_insert (GTK_MENU_SHELL (menushell),
info->proxy, pos);
}
info->proxy = gtk_action_create_tool_item (action);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
- GTK_TOOL_ITEM (info->proxy), pos);
+ GTK_TOOL_ITEM (info->proxy), pos);
+
+ /* FIXME: this is necessary, since tooltips on toolitems
+ * can't be set before the toolitem is added to the toolbar.
+ */
+ g_object_get (G_OBJECT (action), "tooltip", &tooltip, NULL);
+ g_object_set (G_OBJECT (action), "tooltip", tooltip, NULL);
}
}
else
G_CALLBACK (update_smart_separators),
0);
gtk_action_connect_proxy (action, info->proxy);
+
}
g_signal_connect (info->proxy, "notify::visible",
G_CALLBACK (update_smart_separators), 0);
"%*s<UNDECIDED>\n",
"%*s<ui>\n",
"%*s<menubar name=\"%s\">\n",
- "%*s<menu name='%s' action=\"%s\">\n",
+ "%*s<menu name=\"%s\" action=\"%s\">\n",
"%*s<toolbar name=\"%s\">\n",
"%*s<placeholder name=\"%s\">\n",
"%*s<placeholder name=\"%s\">\n",
- "%*s<popup name='%s' action=\"%s\">\n",
+ "%*s<popup name=\"%s\">\n",
"%*s<menuitem name=\"%s\" action=\"%s\"/>\n",
"%*s<toolitem name=\"%s\" action=\"%s\"/>\n",
"%*s<separator name=\"%s\"/>\n",